﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;
using SistemaGO_Desktop.Visao.Telas;

namespace SistemaGO_Desktop
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Process aProcess = Process.GetCurrentProcess();
            string aProcName = aProcess.ProcessName;

            if(Process.GetProcessesByName(aProcName).Length > 1) {
                MessageBox.Show("A aplicação já está rodando", "Erro!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.ExitThread();
            } else {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frmLogin());
            }
        }
    }
}
